package com.draw.b;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.view.*;

public class ColorB {
	
	private int color;
	private int width = 270;
	private int hight = 400;
	private Bitmap bitmap;
	private int ballx;
	private int bally;
	private int ballid;
	private static int countbs=1;
	private Context context;
	private int velx;
	private int vely;	
	public ColorB (Context context,int cordx,int cordy){				
		BitmapFactory.Options bitmapFactory = new BitmapFactory.Options();
		bitmapFactory.inJustDecodeBounds = true ;	

		countbs = ballid;
		countbs++;
		
		velx = 35;
		vely = 35;
		
		ballx = cordx;
		bally = cordy;
		
		WindowManager windowmanger = (WindowManager)context.getSystemService(Context.WINDOW_SERVICE);
		Display display = windowmanger.getDefaultDisplay();
		display.getHeight();
		display.getWidth();
		
		width = display.getWidth();
		hight = display.getHeight();
		
		
		
		
		
		
		

	}
	
	public void setVelx(int x){
		velx = x;
	}
	
	public void setVely(int y){
		vely = y;
	}
	
	public void setBallx(int x){
		ballx = x;
	}
	
	public void setBally(int y){
		bally = y;
	}
	
	public void onMove(int x,int y,ColorB colorb){
		if(ballx >= width){
			ballx-= velx;
			bally-= vely;
			velx = -velx;
			
		}
		
		if(bally >= hight){
			bally-= vely;
			ballx-= velx;
			vely = -vely;
		}
		
		if(ballx <= 0 ){
			ballx-= velx;
			bally-= vely;
			velx = -velx;

		}
		
		if(bally <= 0){
			bally-= vely;
			ballx-= velx;
			vely = -vely;
		}
		

		ballx += velx;
		bally += vely;
		
	}
	
	public int getVelx(){
		return velx;
	}
	
	public int getVely(){
		return vely;
	}
	
	public int getBallx(){
		return ballx;
	}
	
	public int getBally(){
		return bally;
	}
	
	public Bitmap getBit(){
		return bitmap;
	}
	
	public int getId(){
		return ballid;
	}
	
	public void setColor(int c){
		color =c;
		System.out.println("hi");
	}
	public int getColor(){
		return color;
	}
}
